Skip to content

feat(kraefte): set a Fahrzeug's status from where Organisation places it - #857

Merged
DeepDiver1975 merged 1 commit into
mainfrom
feat/827-status-follows-placement
Nov 1, 2026
Merged

DeepDiver1975 merged 1 commit into
mainfrom
feat/827-status-follows-placement

Conversation

@DeepDiver1975

Copy link
Copy Markdown
Contributor

Fixes #827

What

When Organisation places a Fahrzeug, its status in the Kräfte tab now follows:

Placed in Status
Bereitstellungsraum Bereitstellungsraum
Abschnitt / Unterabschnitt Im Einsatz
taken out ("nicht zugeordnet") unchanged

This applies to both ways of placing a unit: the Organisation board (drag-drop and picker) and the ABSCHNITT picker in the Kräfte list.

How

  • The new UnitPlacement helper in LageBuch.AppLogic/Services is used by both LeadershipViewModel.MoveUnit and the picker in ForcesViewModel. It calls the existing MoveForceUnit, then calls UpdateForceUnit when the status changes. The Bemerkung is kept.
  • The status uses the Stammdaten spelling when the catalogue lists a case-insensitive match (StammdatenCatalogue.Normalize). Otherwise it uses the fixed name, so a fresh install without Stammdaten still works.
  • The wire contract is unchanged. The helper uses only the existing session calls, so there is no new SyncCommand and no protocol bump, and a joined client behaves the same. The ETB gets two lines, … → BR Nord and …: Status Auf Anfahrt → Bereitstellungsraum.
  • The helper lives in AppLogic rather than Incident.MoveForceUnit because only AppLogic can see the Stammdaten catalogue, and keeping it there avoids a wire change.

Not in this PR

UI

No .axaml changed. The Kräfte status cell already re-renders from the session, so there are no screenshots.

Evidence

  • make clean ci: all 9 test assemblies pass, 0 errors.
  • make format-check: clean.
  • make codeql: 0 results on changed lines.
  • make mutate PROJECT=AppLogic SINCE=origin/main: 84.2 % on changed lines (16 of 19 caught). Two of the three survivors (FirstOrDefault → First) are now killed by an added test. The third is equivalent: a null implied status only comes from a Partner node, which the domain refuses before anything is written.

🤖 Generated with Claude Code

Placing a unit in a Bereitstellungsraum sets its status to
Bereitstellungsraum; placing it in an Abschnitt or Unterabschnitt sets
Im Einsatz. Both placement paths, the Organisation board and the
Kräfte list's Abschnitt picker, go through the new UnitPlacement
helper. Taking a unit out of its node leaves the status alone.

The status takes the Stammdaten's own spelling when the catalogue lists
it, and the fixed name otherwise. The helper issues the existing
MoveForceUnit and UpdateForceUnit session calls, so the wire contract
is unchanged and the ETB records the move and the status change as two
lines.

Fixes #827

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
@DeepDiver1975
DeepDiver1975 merged commit fc6ba9a into main Nov 1, 2026
16 of 17 checks passed
@DeepDiver1975
DeepDiver1975 deleted the feat/827-status-follows-placement branch November 1, 2026 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sync Fahrzeug status between the Kräfte tab and Organisation

1 participant